function refreshAuthenticode() {
	var img = $('.authenticode');
	var src = img.attr('src').split('?')[0];
	img.attr('src', src+"?"+Math.random());
}

function verify() {
	return true;
}

function register() {
	if (verify()) {
		var inputList = [$('#signInName'), $('#password'), $('#authenticode')];
		var parameters = new Object();
		for (var i in inputList) {
			var input = inputList[i];
			parameters[input.attr('name')] = input.val();
		}
		/*-----=====浏览器控制台输出=====-----
		for (var v in parameters) {
			console.log(v+': '+parameters[v]);
		}
		-----=========================-----*/
		$.post(BASEPATH+'/register.do', parameters, function(data) {
			if (data == '注册成功！') {
				window.location.href = BASEPATH;
			} else {
				alert(data);
				refreshAuthenticode();
			}
		}, 'text');
	}
}

$(document).ready(function() {
	$('.input-text').focusin(function() {
		var id = $(this).attr('id');
		$('#'+id+'Msg').removeClass('hide');
	});
	$('.input-text').focusout(function() {
		var id = $(this).attr('id');
		$('#'+id+'Msg').addClass('hide');
	});
	$('.authenticode').click(refreshAuthenticode);
});